#include <stdio.h>

int main()
{
    int nCase;
    for (scanf("%d", &nCase); nCase--;)
    {
        int d, b[32], i = 0;
        scanf("%d", &d);
        do {
            b[i++] = d % 2;
            d /= 2;
        } while (d > 0);
        while (i > 0)
            printf("%d", b[--i]);
        printf("\n");
    }
    return 0;
}
